<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="../js/vue.js"></script>
    <style>
        .bg{
            background-color: lightblue;
        }
    </style>
</head>
<body>
    <div id="app">
        <div class="bg" v-on:click.capture="doParent">
            <button v-on:click="doThis">事件捕获</button>
        </div>
    </div>
    <script>
        var vm = new Vue({
            el: '#app',
            methods:{
                doParent(){
                    console.log("我是父元素的单击事件");
                    alert("我是父元素的单击事件");
                },
                doThis(){
                    console.log("我是当前元素的单击事件");
                    alert("我是当前元素的单击事件");
                }
            }
        })
    </script>
</body>
</html>